import 'package:flutter/material.dart';


class List extends StatefulWidget {
  List({Key key, @required this.mt}) : super(key: key);
  @override
  ListState createState() {
    return new ListState();
  }
  final String mt;
}

// 有状态控件 ，必须结合一个状态管理类,来是实现
class ListState extends State<List> {
  var list = [];
  String baseUrl = 'https://cn.bing.com';
  // 渲染当前这个控件的结构
  @override
  void initState() {
    super.initState();
    getList();
  }
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text('大美女'),
      ),
      body: Center(
        child: Container(
          child: ListView(
            children: <Widget>[
              new Container(
                color: Colors.lightBlue,
                height: 500,
                child: Image.asset('images/1.png'),
              ),
              new Container(
                color: Colors.pink,
                height: 500,
                child: Image.asset('images/2.png'),
              ),
              new Container(
                color: Colors.cyan,
                height: 500,
                child: Image.asset('images/3.png'),
              ),
            ],
          ),
        ),
      ),
    );
  }
  getList() async {
    print(baseUrl);
    setState(() {
      list = [];
    });
    // print(url);
    // print(response);
    // print(response.data);
  }
}
